<T:ViewBase x:Class="WPFExcelReport.TYLGB02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"   
                    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                    xmlns:me="clr-namespace:WPFExcelReport"  
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    Name="TV"
                    Background="White"    
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel >
            <WrapPanel Height="34">
                <Label Content="{Binding Source={Localization:Translate Word=库}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding LO,ElementName=TV}" Name="txtLO" Width="30" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="20"   Foreground="#FF141111" FontSize="18" />
                <Label Content="{Binding Source={Localization:Translate Word=库区}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox  Text="{Binding LB,ElementName=TV}" Name="txtLB" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="20"   Foreground="#FF141111" FontSize="18"  />
                <Label Content="{Binding Source={Localization:Translate Word=库位}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding LP,ElementName=TV}" Name="txtLP" Width="30" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="20"   Foreground="#FF141111" FontSize="18"/>
                <TextBlock Width="Auto"  VerticalAlignment="Center">批号:</TextBlock>
                <TextBox Text="{Binding KEY1,ElementName=TV}"   Width="151" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="10"   Foreground="#FF141111" FontSize="18"/>
                <TextBlock Width="Auto"  VerticalAlignment="Center">缸号:</TextBlock>
                <TextBox Text="{Binding KEY2,ElementName=TV}"   Width="151" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="10"   Foreground="#FF141111" FontSize="18"/>
                <Label Content="{Binding Source={Localization:Translate Word=品种}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding ART,ElementName=TV}"  Width="100" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="20"   Foreground="#FF141111" FontSize="18" />
                <Label Content="{Binding Source={Localization:Translate Word=色号}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding FARBE, ElementName=TV}" Width="90" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         
                         KeyUp="txtLO_KeyUp" CharacterCasing="Upper" MaxLength="10"   Foreground="#FF141111" FontSize="18"/>
                
                <Button Content="{Binding Source={Localization:Translate Word=查询}}" Height="33" Margin="10,0,0,0"   Width="96" Panel.ZIndex="9"
                        Click="QueryCommand"/>
                <Button Content="{Binding Source={Localization:Translate Word=导出}}" Height="33" Margin="10,0,0,0"   Width="100" Panel.ZIndex="10"
                    Click="PrintCommand"   />
            </WrapPanel>
            
        </StackPanel>

        <DataGrid  Grid.Row="2"   
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"
                   Name="dlgMaster"
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                    >
            <DataGrid.Columns>
                <!--GPSPPART,YSP,GPGART,GPGVAR,GPGFARBE,GPFBPART,PO,GPBEM2,GLLO,GLLB,GLLP ,GPNEUDAT, GPLIEFSCH,GLBSTSP,GLBSTKG,PRICE-->
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=批号}}" Binding="{Binding GPSPPART,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=批号(备注)}}" Binding="{Binding YSP,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=品种}}" Binding="{Binding GPGART}" Width="Auto"/>
                <DataGridTextColumn Header="" Binding="{Binding GPGVAR}" Width="Auto"/> 
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding GPGFARBE,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=品名}}" Binding="{Binding GSHANDLNR,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=缸号}}" Binding="{Binding GPFBPART,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=产地}}" Binding="{Binding PO,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=供应商}}" Binding="{Binding GPBEM2,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库}}" Binding="{Binding GLLO}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库区}}" Binding="{Binding GLLB}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库位}}" Binding="{Binding GLLP}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=入库日期}}" Binding="{Binding GPNEUDAT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=等级}}" Binding="{Binding GPLIEFSCH}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=包数}}" Binding="{Binding GLBSTSP}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=数量}}" Binding="{Binding GLBSTKG}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=单价}}" Binding="{Binding PRICE,Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
        <WrapPanel Grid.Row="1">
            <TextBlock Text="{Binding Source={Localization:Translate Word=总包数:}}"  Margin="600,0,0,0"></TextBlock>
            <TextBlock Name="SBOX" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Source={Localization:Translate Word=总数量:}}"  Margin="20,0,0,0"></TextBlock>
            <TextBlock Name="SQT" Foreground="Red" Margin="20,0,0,0"></TextBlock>  
        </WrapPanel>
    </Grid>

</T:ViewBase>
